import React, { Component } from 'react';
import ReactDOM from 'react-dom';

class LikeButton extends Component {
	constructor(props) {
		super(props);
		this.state = { liked: false };
	}

	handleClick(e) {
		this.setState({ liked: !this.state.liked });
	}

	render(){
		const text = this.state.liked ? 'like' : 'haven\' liked';
		return (
			<p onClick={this.handleClick.bind(this)}>
				You {text} this. Click to toggle.
			</p>
		);
	}
}

ReactDOM.render(<LikeButton />, document.getElementById('like_button_test'));